
var publicData;


//功能函数，进行异步通信
//url , str 要传输的数据
function sendStr(url , str , callback) {
    $.ajax({
        type: "POST",
        url: url,
        contentType:"application/json",
        data: str,
        dataType : "json",
        success : function (response) {
            alert("success in sendStr");
            callback(response);
        },
        error:function(response){
            callback(response);
        }
    });
}
function sendJson(url , json , callback) {
    $.ajax({
        type: "POST",
        url: url,
        contentType:"application/json",
        data: JSON.stringify(json),
        dataType : "json",
        success : function (response) {
            callback(response);
        },
        error:function(response){
            callback(response);
        }
    });
}

// function goin(url,object) {
//     alert(object.id);
//     sendStr(url , object.id , function (res) {
//         alert(res);
//         document.getElementById('res').innerHTML="";
//         analysis(res);
//     });
// }